[
  {
    "title": "GET - /osm/region/{region_id}",
    "path": "/osm/region/{region_id}",
    "method": "GET",
    "description": "Получение информации о регионе",
    "request": {
      "regionId": "long"
    },
    "request_body": {
      "empty": ""
    },
    "response": {
      "id": "long",
      "regionType": "[long]",
      "accountId": "long",
      "name": "string",
      "parentRegion": "string",
      "latitude": "double",
      "longitude": "double",
      "latitude_2": "double",
      "longitude_2": "double",
      "osmData": {
        "mapLink": "string",
        "boundingBox": [
          "double",
          "double",
          "double",
          "double"
        ],
        "pointsOfInterest": [
          {
            "name": "string",
            "type": "string",
            "latitude": "double",
            "longitude": "double"
          }
        ]
      }
    },
    "statuses": [
      {
        "code": 200,
        "description": "Запрос успешно выполнен."
      },
      {
        "code": 400,
        "description": "Один из следующих случаев: Идентификатор региона не указан (regionId = null). Идентификатор региона меньше или равен нулю (regionId <= 0)."
      },
      {
        "code": 401,
        "description": "Неверные авторизационные данные."
      },
      {
        "code": 404,
        "description": "Регион с указанным идентификатором не найден."
      }
    ],
    "example_request": "GET /osm/region/{region_id} HTTP/1.1\nContent-Type: application/json\n\n",
    "example_response": "{\n  \"id\": 123,\n  \"regionType\": [1, 2],\n  \"accountId\": 456,\n  \"name\": \"Moscow\",\n  \"parentRegion\": \"Russia\",\n  \"latitude\": 55.7558,\n  \"longitude\": 37.6176,\n  \"osmData\": {\n    \"mapLink\": \"https://www.openstreetmap.org/search?query=Moscow\",\n    \"boundingBox\": [\n      [\n        55.85222,\n        37.61556\n      ],\n      [\n        55.85222,\n        37.71556\n      ],\n      [\n        55.75222,\n        37.71556\n      ],\n      [\n        55.75222,\n        37.61556\n      ]\n    ],,\n    \"pointsOfInterest\": [\n      {\n        \"name\": \"Red Square\",\n        \"type\": \"historical\",\n        \"latitude\": 55.7539,\n        \"longitude\": 37.6208\n      }\n    ]\n  }\n}"
  },
  {
    "title": "POST - /region",
    "path": "/osm/region",
    "method": "POST",
    "description": "Добавление региона",
    "request": {
      "name": "string",
      "parentRegion": "string or Null",
      "latitude": "double",
      "longitude": "double",
      "latitude_2": "double",
      "longitude_2": "double",
      "osmData": {
        "includePOI": "boolean"
      }
    },
    "response": {
      "id": "long",
      "name": "string",
      "parentRegion": "string or Null",
      "latitude": "double",
      "longitude": "double",
      "latitude_2": "double",
      "longitude_2": "double",
      "osmData": {
        "mapLink": "string",
        "boundingBox": [
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ]
        ],
        "pointsOfInterest": [
          {
            "name": "string",
            "type": "string",
            "latitude": "double",
            "longitude": "double"
          }
        ]
      }
    },
    "statuses": [
      {
        "code": 201,
        "description": "Запрос успешно выполнен."
      },
      {
        "code": 400,
        "description": "Один из следующих случаев: name = null, name = \"\" или состоит из пробелов, latitude или longitude = null."
      },
      {
        "code": 401,
        "description": "Запрос от неавторизованного аккаунта. Неверные авторизационные данные."
      },
      {
        "code": 409,
        "description": "Регион с такими latitude и longitude уже существует."
      }
    ],
    "example_request": "POST /osm/region HTTP/1.1\nContent-Type: application/json\n\n{\n  \"name\": \"Region Name\",\n  \"parentRegion\": \"Parent Region Name\",\n  \"latitude\": 42.123,\n  \"longitude\": -71.456,\n  \"osmData\": {\n    \"includePOI\": true\n  }\n}",
    "example_response": "{\n  \"id\": 123,\n  \"name\": \"Region Name\",\n  \"parentRegion\": \"Parent Region Name\",\n  \"latitude\": 42.123,\n  \"longitude\": -71.456,\n  \"osmData\": {\n    \"mapLink\": \"https://www.openstreetmap.org/search?query=Region+Name\",\n    \"boundingBox\": [\n      [\n        55.85222,\n        37.61556\n      ],\n      [\n        55.85222,\n        37.71556\n      ],\n      [\n        55.75222,\n        37.71556\n      ],\n      [\n        55.75222,\n        37.61556\n      ]\n    ],,\n    \"pointsOfInterest\": [\n      {\n        \"name\": \"Point of Interest\",\n        \"type\": \"Type\",\n        \"latitude\": 42.1,\n        \"longitude\": -71.45\n      }\n    ]\n  }\n}"
  },
  {
    "title": "PUT - /region/{regionId}",
    "path": "/osm/region/{regionId}",
    "method": "PUT",
    "description": "Изменение региона",
    "request": {
      "name": "string",
      "parentRegion": "string or Null",
      "latitude": "double",
      "longitude": "double",
      "latitude_2": "double",
      "longitude_2": "double",
      "osmData": {
        "updatePOI": "boolean"
      }
    },
    "response": {
      "id": "long",
      "name": "string",
      "parentRegion": "string or Null",
      "latitude": "double",
      "longitude": "double",
      "latitude_2": "double",
      "longitude_2": "double",
      "osmData": {
        "mapLink": "string",
        "boundingBox": [
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ],
          [
            "double",
            "double"
          ]
        ],
        "pointsOfInterest": [
          {
            "name": "string",
            "type": "string",
            "latitude": "double",
            "longitude": "double"
          }
        ]
      }
    },
    "statuses": [
      {
        "code": 200,
        "description": "Запрос успешно выполнен."
      },
      {
        "code": 400,
        "description": "Один из следующих случаев: regionId <= 0, regionId = null, name = null, name = \"\" или состоит из пробелов, latitude или longitude = null."
      },
      {
        "code": 401,
        "description": "Запрос от неавторизованного аккаунта. Неверные авторизационные данные."
      },
      {
        "code": 404,
        "description": "Регион с таким regionId не найден."
      },
      {
        "code": 409,
        "description": "Регион с такими latitude и longitude уже существует."
      }
    ],
    "example_request": "PUT /osm/region/123 HTTP/1.1\nContent-Type: application/json\n\n{\n  \"name\": \"Updated Region Name\",\n  \"parentRegion\": \"New Parent Region Name\",\n  \"latitude\": 42.123,\n  \"longitude\": -71.456,\n  \"latitude_2\": 42.223,\n  \"longitude_2\": -71.556,\n  \"osmData\": {\n    \"updatePOI\": true\n  }\n}",
    "example_response": "{\n  \"id\": 123,\n  \"name\": \"Updated Region Name\",\n  \"parentRegion\": \"New Parent Region Name\",\n  \"latitude\": 42.123,\n  \"longitude\": -71.456,\n  \"latitude_2\": 42.223,\n  \"longitude_2\": -71.556,\n  \"osmData\": {\n    \"mapLink\": \"https://www.openstreetmap.org/search?query=Updated+Region+Name\",\n    \"boundingBox\": [\n      [\n        42.123,\n        -71.456\n      ],\n      [\n        42.123,\n        -71.556\n      ],\n      [\n        42.223,\n        -71.556\n      ],\n      [\n        42.223,\n        -71.456\n      ]\n    ],\n    \"pointsOfInterest\": [\n      {\n        \"name\": \"Updated Point of Interest\",\n        \"type\": \"Type\",\n        \"latitude\": 42.1,\n        \"longitude\": -71.45\n      }\n    ]\n  }\n}"
  },
  {
    "title": "GET - /region/weather/{regionId}",
    "path": "/osm/region/weather/{regionId}",
    "method": "GET",
    "description": "Получение информации о погоде в регионе",
    "request": {},
    "response": {
      "id": "long",
      "regionName": "string",
      "temperature": "float",
      "humidity": "float",
      "windSpeed": "float",
      "weatherCondition": "string",
      "precipitationAmount": "float",
      "measurementDateTime": "dateTime",
      "weatherForecast": [
        {
          "forecastId": "long",
          "dateTime": "dateTime",
          "temperature": "float",
          "weatherCondition": "string",
          "precipitationAmount": "float",
          "windSpeed": "float"
        }
      ],
      "osmLink": "string"
    },
    "statuses": [
      {
        "code": 200,
        "description": "Запрос успешно выполнен."
      },
      {
        "code": 400,
        "description": "Один из следующих случаев: regionId = null, regionId <= 0."
      },
      {
        "code": 401,
        "description": "Запрос от неавторизованного аккаунта. Неверные авторизационные данные."
      },
      {
        "code": 404,
        "description": "Регион с таким regionId не найден или погода в данном регионе не доступна."
      }
    ],
    "example_request": "GET /osm/region/weather/123 HTTP/1.1\nContent-Type: application/json\n",
    "example_response": "{\n  \"id\": 123,\n  \"regionName\": \"Region Name\",\n  \"temperature\": 25.4,\n  \"humidity\": 60.5,\n  \"windSpeed\": 5.2,\n  \"weatherCondition\": \"CLEAR\",\n  \"precipitationAmount\": 0.0,\n  \"measurementDateTime\": \"2024-05-24T14:30:00Z\",\n  \"weatherForecast\": [\n    {\n      \"forecastId\": 456,\n      \"dateTime\": \"2024-05-25T14:00:00Z\",\n      \"temperature\": 22.1,\n      \"weatherCondition\": \"CLOUDY\",\n      \"precipitationAmount\": 0.0,\n      \"windSpeed\": 4.3\n    }\n  ],\n  \"osmLink\": \"https://www.openstreetmap.org/search?query=Region+Name\"\n}"
  }
]